<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Common_model extends MY_Model
{
    function Common_model()
    {
        parent::MY_Model();
    }
	function ww_get_res_user_info_by_field($uid, $oasid=0)
	{
		return $this->getRows("CALL ww_get_res_user_info_by_field('$uid', '$oasid')", 0);
	}
	function ww_update_res_by_hour($uid, $oasis_orderid=0, $food, $wood, $metal, $petroleum, $time)
	{
		$this->exeQuery("CALL ww_update_res_by_hour('$uid', '$oasis_orderid', '$food', '$wood', '$metal', '$petroleum', '$time');");
	}
	function ww_get_user_info_build($uid, $oasis_orderid=0)
	{
		return $this->getRows("CALL ww_get_user_info_build('$uid', '$oasis_orderid')", 1);
	}
	function ww_update_build_by_user($uid, $land, $strSuccess, $lstid)
	{
		$this->exeQuery("CALL ww_update_build_by_user('$uid', '$land', '$strSuccess', '$lstid');");
	}
	function ww_get_train_user_info($uid, $type)
	{
		return $this->getRows("CALL ww_get_train_user_info($uid, $type);", 1);
	}
	function ww_update_quantity_for_time($id, $uid, $oasis_orderid, $quantity)
	{
		$this->exeQuery("CALL ww_update_quantity_for_time('$id', '$uid', '$oasis_orderid', '$quantity');");
	}
	function ww_get_send_resource_by_user($uid, $oasis_orderid)
	{
		return $this->getRows("CALL ww_get_send_resource_by_user('$uid', '$oasis_orderid');", 1);
	}
	function ww_get_all_resource_from_user($uid, $oasis_orderid)
	{
        return $this->getRows("CALL ww_get_all_resource_from_user('$uid', '$oasis_orderid');", 1);
	}
	function ww_update_all_resource_from_user($lstid, $tuid, $oasis_orderid, $tt_food, $tt_wood, $tt_metal, $tt_petro)
	{
		$this->exeQuery("CALL ww_update_all_resource_from_user('$lstid', '$tuid', '$oasis_orderid', '$tt_food', '$tt_wood', '$tt_metal', '$tt_petro');");
	}
	function ww_update_quantity_military($uid, $oasis_orderid=0, $strComplete, $lstid)
	{
		$this->exeQuery("CALL ww_update_quantity_military('$uid', '$oasis_orderid', '$strComplete', '$lstid');");
	}
    function ww_get_map_user_info($userid, $user_oasis_orderid)
    {
        return $this->getRows("CALL ww_get_map_user_info('$userid', '$user_oasis_orderid')", 0);
    }
}